﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MVVMLightDemo.Models
{
    public class MenuItemModel:ObservableObject
    {
        private string name;

        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
                this.RaisePropertyChanged(nameof(Name));
            }
        }

        private List<MenuItemModel> children;

        public List<MenuItemModel> Children
        {
            get
            {
                return children;
            }
            set
            {
                children = value;
                this.RaisePropertyChanged(nameof(Children));
            }
        }

        private RelayCommand command;

        public RelayCommand Command
        {
            get
            {
                return command;
            }
            set
            {
                command = value;
                this.RaisePropertyChanged(nameof(Command));
            }
        }

        public MenuItemModel()
        {
            this.Children = new List<MenuItemModel>();
        }

        public MenuItemModel(string na, RelayCommand cmd, List<MenuItemModel> list)
        {
            this.Name = na;
            this.Command = cmd;
            this.Children = list;
        }
    }
}
